package it.poste.il.compensatore.control;

import it.poste.il.compensatore.entities.MessageBody;
import it.poste.il.compensatore.entities.SDPRequest;
import it.poste.il.compensatore.exceptions.CompensatorIOException;
import it.poste.il.compensatore.exceptions.CompensatorTimeOutException;

/**
 * Interface of Integration.
 */
public interface Integration {

	/**
	 * Method syncMsg.
	 * Read input message, load requestID, store message
	 * check annullament and reset
	 * send to ESB.
	 * @param input message from SDP
	 * @return ESB reply ;
	 * @throws Exception 
	 */
	String syncMsg(String msg) throws Exception;

	/**
	 * Method annullament.
	 * Make annullament message.
	 * @return null;
	 */
	void cancel(String sdpRequestId);

	/**
	 * Method reset.
	 * Make reset .
	 * @return null;
	 */
	void reset(SDPRequest adpRequest);

	/**
	 * Method send.
	 * Send message to ESB and return error message.
	 * @return response;
	 * @throws CompensatorTimeOutException 
	 * @throws CompensatorIOException 
	 */
	String send(MessageBody msgBody) throws CompensatorTimeOutException, CompensatorIOException,Exception;
}
